        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>TimeOfImpactSolverManifold class / box2d_html Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d_html" data-type="TimeOfImpactSolverManifold">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d_html.html">box2d_html</a> &rsaquo; <a href="../box2d_html/TimeOfImpactSolverManifold.html">TimeOfImpactSolverManifold</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>TimeOfImpactSolverManifold</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class TimeOfImpactSolverManifold {
  final Vector normal;
  final Vector point;
  num separation;

  /** Pooling */
  final Vector pointA;
  final Vector pointB;
  final Vector temp;
  final Vector planePoint;
  final Vector clipPoint;

  /** constructor that initiliazes everything. */
  TimeOfImpactSolverManifold() :
    normal = new Vector(),
    point = new Vector(),
    separation = 0,
    pointA = new Vector(),
    pointB = new Vector(),
    temp = new Vector(),
    planePoint = new Vector(),
    clipPoint = new Vector() { }

  void initialize(TimeOfImpactConstraint cc, int index) {
    assert(cc.pointCount &gt; 0);

    switch (cc.type) {
      case ManifoldType.CIRCLES:
        pointA.setFrom(cc.bodyA.getWorldPoint(cc.localPoint));
        pointB.setFrom(cc.bodyB.getWorldPoint(cc.localPoints[0]));
        if (MathBox.distanceSquared(pointA, pointB) &gt; Settings.EPSILON
            * Settings.EPSILON) {
          normal.setFrom(pointB).subLocal(pointA);
          normal.normalize();
        } else {
          normal.setCoords(1, 0);
        }

        point.setFrom(pointA).addLocal(pointB).mulLocal(.5);
        temp.setFrom(pointB).subLocal(pointA);
        separation = Vector.dot(temp, normal) - cc.radius;
        break;

      case ManifoldType.FACE_A:
        normal.setFrom(cc.bodyA.getWorldVector(cc.localNormal));
        planePoint.setFrom(cc.bodyA.getWorldPoint(cc.localPoint));

        clipPoint.setFrom(cc.bodyB.getWorldPoint(cc.localPoints[index]));
        temp.setFrom(clipPoint).subLocal(planePoint);
        separation = Vector.dot(temp, normal) - cc.radius;
        point.setFrom(clipPoint);
        break;

      case ManifoldType.FACE_B:
        normal.setFrom(cc.bodyB.getWorldVector(cc.localNormal));
        planePoint.setFrom(cc.bodyB.getWorldPoint(cc.localPoint));

        clipPoint.setFrom(cc.bodyA.getWorldPoint(cc.localPoints[index]));
        temp.setFrom(clipPoint).subLocal(planePoint);
        separation = Vector.dot(temp, normal) - cc.radius;
        point.setFrom(clipPoint);

        // Ensure normal points from A to B
        normal.negateLocal();
        break;
    }
  }
}
</pre>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="TimeOfImpactSolverManifold">
<button class="show-code">Code</button>
new <strong>TimeOfImpactSolverManifold</strong>() <a class="anchor-link" href="#TimeOfImpactSolverManifold"
              title="Permalink to TimeOfImpactSolverManifold.TimeOfImpactSolverManifold">#</a></h4>
<div class="doc">
<p>constructor that initiliazes everything.</p>
<pre class="source">
TimeOfImpactSolverManifold() :
  normal = new Vector(),
  point = new Vector(),
  separation = 0,
  pointA = new Vector(),
  pointB = new Vector(),
  temp = new Vector(),
  planePoint = new Vector(),
  clipPoint = new Vector() { }
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="clipPoint">
<button class="show-code">Code</button>
final <a href="../box2d_html/Vector.html">Vector</a>         <strong>clipPoint</strong> <a class="anchor-link"
            href="#clipPoint"
            title="Permalink to TimeOfImpactSolverManifold.clipPoint">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Vector clipPoint;
</pre>
</div>
</div>
<div class="field"><h4 id="normal">
<button class="show-code">Code</button>
final <a href="../box2d_html/Vector.html">Vector</a>         <strong>normal</strong> <a class="anchor-link"
            href="#normal"
            title="Permalink to TimeOfImpactSolverManifold.normal">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Vector normal;
</pre>
</div>
</div>
<div class="field"><h4 id="planePoint">
<button class="show-code">Code</button>
final <a href="../box2d_html/Vector.html">Vector</a>         <strong>planePoint</strong> <a class="anchor-link"
            href="#planePoint"
            title="Permalink to TimeOfImpactSolverManifold.planePoint">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Vector planePoint;
</pre>
</div>
</div>
<div class="field"><h4 id="point">
<button class="show-code">Code</button>
final <a href="../box2d_html/Vector.html">Vector</a>         <strong>point</strong> <a class="anchor-link"
            href="#point"
            title="Permalink to TimeOfImpactSolverManifold.point">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Vector point;
</pre>
</div>
</div>
<div class="field"><h4 id="pointA">
<button class="show-code">Code</button>
final <a href="../box2d_html/Vector.html">Vector</a>         <strong>pointA</strong> <a class="anchor-link"
            href="#pointA"
            title="Permalink to TimeOfImpactSolverManifold.pointA">#</a>
        </h4>
        <div class="doc">
<p>Pooling</p>
<pre class="source">
final Vector pointA;
</pre>
</div>
</div>
<div class="field"><h4 id="pointB">
<button class="show-code">Code</button>
final <a href="../box2d_html/Vector.html">Vector</a>         <strong>pointB</strong> <a class="anchor-link"
            href="#pointB"
            title="Permalink to TimeOfImpactSolverManifold.pointB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Vector pointB;
</pre>
</div>
</div>
<div class="field inherited"><h4 id="runtimeType">
<button class="show-code">Code</button>
final Type         <strong>runtimeType</strong> <a class="anchor-link"
            href="#runtimeType"
            title="Permalink to TimeOfImpactSolverManifold.runtimeType">#</a>
        </h4>
        <div class="inherited-from">inherited from Object </div><div class="doc">
<p>A representation of the runtime type of the object.</p>
<pre class="source">
external Type get runtimeType;
</pre>
</div>
</div>
<div class="field"><h4 id="separation">
<button class="show-code">Code</button>
num         <strong>separation</strong> <a class="anchor-link"
            href="#separation"
            title="Permalink to TimeOfImpactSolverManifold.separation">#</a>
        </h4>
        <div class="doc">
<pre class="source">
num separation;
</pre>
</div>
</div>
<div class="field"><h4 id="temp">
<button class="show-code">Code</button>
final <a href="../box2d_html/Vector.html">Vector</a>         <strong>temp</strong> <a class="anchor-link"
            href="#temp"
            title="Permalink to TimeOfImpactSolverManifold.temp">#</a>
        </h4>
        <div class="doc">
<pre class="source">
final Vector temp;
</pre>
</div>
</div>
</div>
<div>
<h3>Operators</h3>
<div class="method inherited"><h4 id="==">
<button class="show-code">Code</button>
bool <strong>operator ==</strong>(other) <a class="anchor-link" href="#=="
              title="Permalink to TimeOfImpactSolverManifold.operator ==">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>The equality operator.</p>
<p>The default behavior for all <code>Object</code>s is to return true if and
only if <code>this</code> and 
<span class="param">other</span> are the same object.</p>
<p>If a subclass overrides the equality operator it should override
the <code>hashCode</code> method as well to maintain consistency.</p>
<pre class="source">
bool operator ==(other) =&gt; identical(this, other);
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method inherited"><h4 id="hashCode">
<button class="show-code">Code</button>
int <strong>hashCode</strong>() <a class="anchor-link" href="#hashCode"
              title="Permalink to TimeOfImpactSolverManifold.hashCode">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>Get a hash code for this object.</p>
<p>All objects have hash codes. Hash codes are guaranteed to be the
same for objects that are equal when compared using the equality
operator <code>==</code>. Other than that there are no guarantees about
the hash codes. They will not be consistent between runs and
there are no distribution guarantees.</p>
<p>If a subclass overrides <code>hashCode</code> it should override the
equality operator as well to maintain consistency.</p>
<pre class="source">
external int hashCode();
</pre>
</div>
</div>
<div class="method"><h4 id="initialize">
<button class="show-code">Code</button>
void <strong>initialize</strong>(<a href="../box2d_html/TimeOfImpactConstraint.html">TimeOfImpactConstraint</a> cc, int index) <a class="anchor-link" href="#initialize"
              title="Permalink to TimeOfImpactSolverManifold.initialize">#</a></h4>
<div class="doc">
<pre class="source">
void initialize(TimeOfImpactConstraint cc, int index) {
  assert(cc.pointCount &gt; 0);

  switch (cc.type) {
    case ManifoldType.CIRCLES:
      pointA.setFrom(cc.bodyA.getWorldPoint(cc.localPoint));
      pointB.setFrom(cc.bodyB.getWorldPoint(cc.localPoints[0]));
      if (MathBox.distanceSquared(pointA, pointB) &gt; Settings.EPSILON
          * Settings.EPSILON) {
        normal.setFrom(pointB).subLocal(pointA);
        normal.normalize();
      } else {
        normal.setCoords(1, 0);
      }

      point.setFrom(pointA).addLocal(pointB).mulLocal(.5);
      temp.setFrom(pointB).subLocal(pointA);
      separation = Vector.dot(temp, normal) - cc.radius;
      break;

    case ManifoldType.FACE_A:
      normal.setFrom(cc.bodyA.getWorldVector(cc.localNormal));
      planePoint.setFrom(cc.bodyA.getWorldPoint(cc.localPoint));

      clipPoint.setFrom(cc.bodyB.getWorldPoint(cc.localPoints[index]));
      temp.setFrom(clipPoint).subLocal(planePoint);
      separation = Vector.dot(temp, normal) - cc.radius;
      point.setFrom(clipPoint);
      break;

    case ManifoldType.FACE_B:
      normal.setFrom(cc.bodyB.getWorldVector(cc.localNormal));
      planePoint.setFrom(cc.bodyB.getWorldPoint(cc.localPoint));

      clipPoint.setFrom(cc.bodyA.getWorldPoint(cc.localPoints[index]));
      temp.setFrom(clipPoint).subLocal(planePoint);
      separation = Vector.dot(temp, normal) - cc.radius;
      point.setFrom(clipPoint);

      // Ensure normal points from A to B
      normal.negateLocal();
      break;
  }
}
</pre>
</div>
</div>
<div class="method inherited"><h4 id="noSuchMethod">
<button class="show-code">Code</button>
<strong>noSuchMethod</strong>(String name, List args) <a class="anchor-link" href="#noSuchMethod"
              title="Permalink to TimeOfImpactSolverManifold.noSuchMethod">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p><code>noSuchMethod</code> is invoked when users invoke a non-existant method
on an object. The name of the method and the arguments of the
invocation are passed to <code>noSuchMethod</code>. If <code>noSuchMethod</code>
returns a value, that value becomes the result of the original
invocation.</p>
<p>The default behavior of <code>noSuchMethod</code> is to throw a
<code>noSuchMethodError</code>.</p>
<pre class="source">
external Dynamic noSuchMethod(String name, List args);
</pre>
</div>
</div>
<div class="method inherited"><h4 id="Object">
<button class="show-code">Code</button>
const <strong>Object</strong>() <a class="anchor-link" href="#Object"
              title="Permalink to TimeOfImpactSolverManifold.Object">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>Creates a new <code>Object</code> instance.</p>
<p><code>Object</code> instances have no meaningful state, and are only useful
through their identity. An <code>Object</code> instance is equal to itself
only.</p>
<pre class="source">
const Object();
</pre>
</div>
</div>
<div class="method"><h4 id="TimeOfImpactSolverManifold">
<button class="show-code">Code</button>
new <strong>TimeOfImpactSolverManifold</strong>() <a class="anchor-link" href="#TimeOfImpactSolverManifold"
              title="Permalink to TimeOfImpactSolverManifold.TimeOfImpactSolverManifold">#</a></h4>
<div class="doc">
<p>constructor that initiliazes everything.</p>
<pre class="source">
TimeOfImpactSolverManifold() :
  normal = new Vector(),
  point = new Vector(),
  separation = 0,
  pointA = new Vector(),
  pointB = new Vector(),
  temp = new Vector(),
  planePoint = new Vector(),
  clipPoint = new Vector() { }
</pre>
</div>
</div>
<div class="method inherited"><h4 id="toString">
<button class="show-code">Code</button>
String <strong>toString</strong>() <a class="anchor-link" href="#toString"
              title="Permalink to TimeOfImpactSolverManifold.toString">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>Returns a string representation of this object.</p>
<pre class="source">
external String toString();
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
